
#include<stdio.h>

int removeDuplicates(int* nums, int numsSize) {
    int begin = 0;
    int str = 0;
    while (str < numsSize)
    {
        if (nums[begin] == nums[str])
        {
            str++;
        }
        else
        {
            begin++;
            nums[begin] = nums[str];
            str++;
        }
    }
    return begin + 1;
}

int main()
{
    int nums[3] = {1, 1, 2};
    int k = removeDuplicates(nums, 3);
    printf("%d\n", k);
	return 0;
}



void merge(int* nums1, int nums1Size, int m, int* nums2, int nums2Size, int n) {
    int end1 = m + n - 1;
    int end2 = n - 1;
    while (end2 >= 0 && m >= 1)
    {
        if (nums1[m - 1] <= nums2[end2])
        {
            nums1[end1] = nums2[end2];
            end2--;
        }
        else
        {
            nums1[end1] = nums1[m - 1];
            m--;
        }
        end1--;
    }
    while (end2 >= 0)
    {
        nums1[end1--] = nums2[end2--];
    }
}

int main()
{
    int nums1[6] = { 1, 2, 3, 0, 0, 0};
    int m = 3;
    int nums2[3] = { 2, 5, 6 };
    int n = 3;
    merge(nums1, 6, m, nums2, 3, n);
    return 0;
}